﻿using System;
using System.Configuration;
using LaxCraft.Attributes;
using LaxCraft.Domain;
using LaxCraft.Helpers;

namespace LaxCraft.Controllers
{
	using System.Web.Mvc;
    using System.Linq;
	using LaxCraft.Repositories;

	public class ScholarController : Controller
	{
		private readonly ILinkRepository links;

        public ScholarController(ILinkRepository links)
		{
			this.links = links;
		}

		public ActionResult Index()
		{
		    ViewBag.Links = links.GetLinks().OrderBy(l => l.Category).OrderBy(l => l.Name).ToList();

            return View(ViewBag);
		}

	}
}